﻿<UserControl x:Class="Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule.UserCatalogCenterPane"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="VisibilityConverter"></BooleanToVisibilityConverter>

        <Style x:Key="ButtonStyleUser" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="resume_grid">
                            <Ellipse Stroke="#CCFFFFFF" StrokeThickness="2" x:Name="playbuttonbg2">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF0D7BB3" Offset="0"/>
                                        <GradientStop Color="#FF83C6EC" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Path Stretch="Fill" Stroke="{x:Null}" StrokeThickness="1.5" Height="11.621" Data="M8.6253329,12.875359 C11.792333,4.0427084 19.500333,5.500333 19.500333,5.500333 30.125334,6.7505247 29.625335,16.875153 29.625335,16.875153 21.750333,10.6254 8.6253329,12.875359 8.6253329,12.875359 z" x:Name="playbuttonshade2" Margin="3.793,3.087,3.036,0" VerticalAlignment="Top">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                        <GradientStop Color="#B2FFFFFF" Offset="0"/>
                                        <GradientStop Color="#00FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Image Source="/Microsoft.Research.ScientificWorkflow.TridentUtilities;component/Images/ManagementStudio/user.png" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5.25,4.725,0,0"/>
                            <Path RenderTransformOrigin="0.499999978633752,0.499999997021052" HorizontalAlignment="Stretch" Margin="11.055,12.412,5.661,4.304" VerticalAlignment="Stretch" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF154D6A" StrokeThickness="0.5" Data="M2.9960001,0 L6.2880001,0 6.2880001,2.996 9.2840004,2.996 9.2840004,6.2880001 6.2880001,6.2880001 6.2880001,9.2840002 2.9960001,9.2840002 2.9960001,6.2880001 0,6.2880001 0,2.996 2.9960001,2.996 2.9960001,0 z">
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="90"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF095A84" Offset="0"/>
                                            <GradientStop Color="#FF53A4D2" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF0091DA" Offset="0"/>
                                            <GradientStop Color="#FF00314D" Offset="0.996"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="Fill" TargetName="playbuttonshade2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF828282" Offset="0"/>
                                            <GradientStop Color="#FFEAEAEA" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ButtonDelete" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="resume_grid">
                            <Ellipse Stroke="#CCFFFFFF" StrokeThickness="2" x:Name="playbuttonbg2">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF0D7BB3" Offset="0"/>
                                        <GradientStop Color="#FF83C6EC" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Path Stretch="Fill" Stroke="{x:Null}" StrokeThickness="1.5" Height="11.621" Data="M8.6253329,12.875359 C11.792333,4.0427084 19.500333,5.500333 19.500333,5.500333 30.125334,6.7505247 29.625335,16.875153 29.625335,16.875153 21.750333,10.6254 8.6253329,12.875359 8.6253329,12.875359 z" x:Name="playbuttonshade2" Margin="3.793,3.087,3.036,0" VerticalAlignment="Top">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                        <GradientStop Color="#B2FFFFFF" Offset="0"/>
                                        <GradientStop Color="#00FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="{x:Null}" Margin="6.907,7.842,7.296,7.393" Data="M8.6633333,18.54 C9.3901271,20.00197 11.864971,10.934077 17.913666,8.6233342 18.38935,8.60359 18.414017,9.6236337 18.414017,9.6236337 17.495088,10.738833 14.204652,10.904728 11.767908,18.227208 11.517902,18.664991 10.111685,19.008701 8.6633333,18.54 z" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="17.908"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                            <Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="{x:Null}" Margin="7.767,7.686,6.436,7.549" Data="M8.6633333,18.54 C9.1424293,19.714072 11.464473,10.390612 17.913666,8.6233342 18.38935,8.60359 18.414017,9.6236337 18.414017,9.6236337 17.814142,10.624958 14.44488,10.489059 11.767908,18.227208 11.517902,18.664991 10.111685,19.008701 8.6633333,18.54 z" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="-1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="14.745"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF095A84" Offset="0"/>
                                            <GradientStop Color="#FF53A4D2" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF0091DA" Offset="0"/>
                                            <GradientStop Color="#FF00314D" Offset="0.996"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="Fill" TargetName="playbuttonshade2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF828282" Offset="0"/>
                                            <GradientStop Color="#FFEAEAEA" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <DataTemplate x:Key="LoginCredentialTemplate">
            <Grid >
                <TextBlock HorizontalAlignment="Stretch" Grid.Column="0" Margin="1,0,0,0" Text="{Binding Path=CredentialName}" ToolTip="{Binding Path=CredentialDisplayName}" AutomationProperties.AutomationId="{Binding Path=CredentialName}"></TextBlock>
            </Grid>
        </DataTemplate>


        <DataTemplate x:Key="RolesTemplate">
            <Grid >
                <CheckBox HorizontalAlignment="Left" Width="Auto" VerticalAlignment="Top" Margin="0,2,0,0" Content="{Binding Path=RoleName}"  IsChecked="{Binding Path=RoleSelected}" AutomationProperties.AutomationId="AIDchkRoles"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="GroupsTemplate">
            <Grid >
                <CheckBox HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,2,0,0" Content="{Binding Path=GroupName}"  IsChecked="{Binding Path=IsSelected}" AutomationProperties.AutomationId="AIDchkGroups"/>
            </Grid>
        </DataTemplate>

    </UserControl.Resources>
    <Grid HorizontalAlignment="Stretch" Margin="7,5,5,5" VerticalAlignment="Stretch" Grid.Column="1">
        <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="4,4,4,4" BorderThickness="1,1,1,1" Background="#FFFFFFFF" BorderBrush="#FFE0E0E0">
            <Grid Margin="0,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="36"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Border CornerRadius="5,5,0,0" Grid.Row="1">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFBFBFB" Offset="0"/>
                            <GradientStop Color="#FFF0F0F0" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <StackPanel Orientation="Horizontal">
                        <Button Style="{DynamicResource ButtonStyleUser}" Width="26" Height="26" Content="Button" x:Name="AddButton_Copy" Command="{Binding Path=AddUserCommand}"  ToolTip="Add User" Margin="5,0,0,0"/>
                        <Button Style="{DynamicResource ButtonDelete}" Width="26" Height="26" Content="Button" x:Name="DeleteButton_Copy" Command="{Binding Path=DeleteUserCommand}" ToolTipService.ShowOnDisabled="True" ToolTip="Delete" Margin="5,0,0,0"  /> 
                    </StackPanel>
                </Border>
                <Border Margin="0,0,0,0" CornerRadius="5,5,0,0" BorderThickness="0,0,0,1" BorderBrush="#FFFFFFFF">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                            <GradientStop Color="#FFE8E8E8" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock Text="User" TextWrapping="Wrap" FontSize="14" FontWeight="Normal" Margin="7,2,0,0"/>
						</Border>
                <Grid VerticalAlignment="Stretch" Grid.RowSpan="1" Grid.Row="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" MinHeight="67.104"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="40"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid HorizontalAlignment="Stretch" Margin="10,10,10,10" Grid.ColumnSpan="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="72"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Width="72" HorizontalAlignment="Left" Source="/Microsoft.Research.ScientificWorkflow.TridentUtilities;component/Images/ManagementStudio/headerUser.png" d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Top"/>
                        <TextBlock TextAlignment="Justify" VerticalAlignment="Top" Text="User authentication is required to attain permissions to use the system.  Adding a user to a system, enable the admin to grant the necessary permissions need by the user.  In Trident the users are mapped to the windows authentication model.  This catalog allows the user to maintain the users in the Trident system. The changes related to roles and active/inactive status for the user will be applicable after the application has been restarted." TextWrapping="Wrap" d:LayoutOverrides="Width" Margin="10,0,0,0" Grid.Column="1"/>
							</Grid>
                    <Border BorderBrush="#FFDADADA" BorderThickness="0,1,0,0" Padding="0,10,0,0" VerticalAlignment="Stretch" Grid.Row="2">
                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding Path=EditableUserModel.NonVirtualUser, Converter={StaticResource VisibilityConverter}}">
                            <Button  AutomationProperties.AutomationId="AIDUserSave"  HorizontalAlignment="Right" VerticalAlignment="Top" Width="70" Content="Save" Command="{Binding Path=SaveUserCommand}" Margin="0,0,100,0"  Height="21.96" />
                            <Button  AutomationProperties.AutomationId="AIDGroupCancel"  HorizontalAlignment="Right" Width="70" Content="Cancel" d:LayoutOverrides="Height" Command="{Binding Path=CancelUserChangesCommand}" Margin="0,0,20,0"  VerticalAlignment="Top"  />
                        </Grid>
                    </Border>
                    <Border Margin="60,15,10,0" Grid.RowSpan="1" Grid.Row="1" BorderBrush="#FFDEDEDE" BorderThickness="0,1,0,0">
                        <ScrollViewer  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" BorderBrush="#FFB2B2B2" BorderThickness="0,1,0,0" Visibility="{Binding Path=EditableUserModel.NonVirtualUser, Converter={StaticResource VisibilityConverter}}" >
                            <Grid Margin="0,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="125"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" MinHeight="20.2"/>
                                    <RowDefinition Height="Auto" MinHeight="19.04"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" MinHeight="8.80000000000001"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" MinHeight="19.44"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" MinHeight="0"/>
                                </Grid.RowDefinitions>
                                <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Text="ID:" TextWrapping="Wrap" Margin="0,5,5,0"/>
										<TextBlock HorizontalAlignment="Right" Text="Active:" TextWrapping="Wrap" d:LayoutOverrides="Height" Grid.Row="4" Margin="0,5,5,0" VerticalAlignment="Top"/>
										<TextBlock Text="Created Date:" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" Grid.Row="8" Margin="0,5,5,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
										<TextBlock Text="Modified By:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="9" HorizontalAlignment="Right" VerticalAlignment="Top"/>
										<TextBlock Text="Modified Date:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="10" VerticalAlignment="Top" HorizontalAlignment="Right"/>
										<TextBox Text="{Binding Path=EditableUserModel.DisplayId}"  TextWrapping="Wrap" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="0" Width="250" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" IsEnabled="False" TabIndex="0" AutomationProperties.AutomationId="AIDUserId" />
										<TextBlock Text="Groups:" TextWrapping="Wrap" Margin="0,5,5,0" VerticalAlignment="Top" d:LayoutOverrides="Width" HorizontalAlignment="Right" Grid.Row="6"/>
								     <Grid VerticalAlignment="Top" Grid.Row="1" Margin="0,5,8,0" HorizontalAlignment="Right">
                                        <Grid Margin="0,-0.5,-7.5,0" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Top">
                                            <Path RenderTransformOrigin="0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Fill="#FFFF0000" Stretch="Fill" StrokeThickness="0" Data="M18.597656,17.335052 L25.59375,17.335052 L25.382813,29.253021 L36.210938,22.010834 L39.832031,27.424896 L27.667969,34.561615 L39.832031,41.768646 L36.210938,47.112396 L25.242188,39.624115 L25.628906,51.85849 L18.597656,51.85849 L18.808594,39.975677 L8.0859375,47.147552 L4.5,41.73349 L16.59375,34.596771 L4.5703125,27.38974 L8.0859375,21.975677 L18.808594,29.253021 z">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
                                                        <SkewTransform AngleX="0" AngleY="0"/>
                                                        <RotateTransform Angle="0"/>
                                                        <TranslateTransform X="0" Y="0"/>
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                            </Path>
                                        </Grid>
                                           <TextBlock HorizontalAlignment="Right" Text="Name:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Height"  VerticalAlignment="Top"/>
                                    </Grid>		
                                
										<TextBox AutomationProperties.AutomationId="AIDCreatedDate" Text="{Binding Path=EditableUserModel.DisplayCreatedDate}" TextWrapping="NoWrap" d:LayoutOverrides="Height" Grid.Row="8" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Margin="0,5,0,0" IsEnabled="False" TabIndex="10" />
										<TextBox AutomationProperties.AutomationId="AIDModifiedDate" Text="{Binding Path=EditableUserModel.DisplayLastModifiedTime}" TextWrapping="Wrap" Margin="0,5,0,0" d:LayoutOverrides="Height" Grid.Row="10" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Grid.Column="1" IsEnabled="False" TabIndex="12" />
										<TextBlock Text="Created By:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="7" HorizontalAlignment="Right" VerticalAlignment="Top"/>
										<TextBox AutomationProperties.AutomationId="AIDCreatedBy" Text="{Binding Path=EditableUserModel.CreatedBy}" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,5,0,0" Width="250" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="7" VerticalAlignment="Top" IsEnabled="False" TabIndex="9" />
										<TextBox AutomationProperties.AutomationId="AIDModifiedBy" Text="{Binding Path=EditableUserModel.LastModifiedBy}" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,5,0,0" Width="250" IsEnabled="False" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="9" TabIndex="11" />
								 <CheckBox AutomationProperties.AutomationId="AIDStatus" IsChecked="{Binding Path=EditableUserModel.Status}" HorizontalAlignment="Left"  Margin="0,5,0,0" Grid.Column="1" Grid.Row="4" d:LayoutOverrides="Height" VerticalAlignment="Top" TabIndex="6" />
                               
										<StackPanel Orientation="Horizontal" Visibility="Visible" Grid.Column="1" Grid.Row="2" Grid.RowSpan="1" d:LayoutOverrides="Width, Height" VerticalAlignment="Top" Margin="0,5,0,0">
											<ListBox  Width="250" IsSynchronizedWithCurrentItem="True" Height="65" SelectionChanged="OnCredentialsSelectionChanged" ItemsSource="{Binding Path=EditableUserModel.Credentials}" 
                                                      ItemTemplate="{StaticResource LoginCredentialTemplate}" AutomationProperties.AutomationId="AIDCredentialList" TabIndex="2" />
											<StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="5,5,0,0"   VerticalAlignment="Bottom">
												<Button AutomationProperties.AutomationId="AIDAddCredential" Width="60" Content="Add" Margin="0,5,0,0" VerticalAlignment="Top" Command="{Binding Path=AddUserCredentialCommand}" TabIndex="3" />
												<Button Width="60" AutomationProperties.AutomationId="AIDRemoveCredential" Content="Remove" Margin="0,5,0,0" Command="{Binding Path=RemoveUserCredentialCommand}" TabIndex="4" />
											</StackPanel>
										</StackPanel>
                                     <Grid VerticalAlignment="Top" Grid.Row="2" Margin="0,5,8,0" HorizontalAlignment="Right">
                                        <Grid Margin="0,-0.5,-7.5,0" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Top">
                                            <Path RenderTransformOrigin="0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Fill="#FFFF0000" Stretch="Fill" StrokeThickness="0" Data="M18.597656,17.335052 L25.59375,17.335052 L25.382813,29.253021 L36.210938,22.010834 L39.832031,27.424896 L27.667969,34.561615 L39.832031,41.768646 L36.210938,47.112396 L25.242188,39.624115 L25.628906,51.85849 L18.597656,51.85849 L18.808594,39.975677 L8.0859375,47.147552 L4.5,41.73349 L16.59375,34.596771 L4.5703125,27.38974 L8.0859375,21.975677 L18.808594,29.253021 z">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
                                                        <SkewTransform AngleX="0" AngleY="0"/>
                                                        <RotateTransform Angle="0"/>
                                                        <TranslateTransform X="0" Y="0"/>
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                            </Path>
                                        </Grid>
										<TextBlock Text="Credentials" TextWrapping="Wrap" Margin="0,5,5,0" VerticalAlignment="Top" HorizontalAlignment="Right" />
                                         </Grid>
										<TextBlock HorizontalAlignment="Right" Text="Description:" TextWrapping="Wrap" Margin="0,5,5,0" Grid.Row="3" d:LayoutOverrides="Height" VerticalAlignment="Top"/>
										<TextBox AutomationProperties.AutomationId="AIDUserDescription" HorizontalAlignment="Left" MaxLength="300" Width="250" Text="{Binding Path=EditableUserModel.Description}" TextWrapping="Wrap" MaxLines="3" Margin="0,5,0,0" IsEnabled="True" VerticalScrollBarVisibility="Auto" Grid.Column="1" Grid.Row="3" VerticalAlignment="Top" Height="60" TabIndex="5" />
                            
                                <TextBlock HorizontalAlignment="Right" Grid.Row="5"  Text="Role:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Height" VerticalAlignment="Top"/>
										<TextBox AutomationProperties.AutomationId="AIDUserName" HorizontalAlignment="Left" MaxLength="75" Width="250" Text="{Binding Path=EditableUserModel.Name}" TextWrapping="NoWrap" Margin="0,5,0,0" IsEnabled="True" Grid.Column="1" Grid.Row="1" d:LayoutOverrides="Height" Grid.RowSpan="1" TabIndex="1" />
										<ListBox IsSynchronizedWithCurrentItem="True" Margin="0,5,0,0" Grid.Row="5" Grid.Column="1" VerticalAlignment="Top" 
                                                 HorizontalAlignment="Left" Width="250" Height="65"
                                                 ItemsSource="{Binding Path=EditableUserModel.Roles}" 
                                                 ItemTemplate="{StaticResource RolesTemplate}" 
                                                 AutomationProperties.AutomationId="AIDRolesList" TabIndex="7" >
                                            <ListBox.Resources>
                                                 <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                            </ListBox.Resources>
											
										</ListBox>
										<ListBox IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Left" Width="250" Grid.Column="1" 
                                                 Grid.Row="6" VerticalAlignment="Top" Margin="0,5,0,0" Height="65"
                                                 ItemsSource="{Binding Path=EditableUserModel.Groups}" 
                                                 ItemTemplate="{StaticResource GroupsTemplate}"
                                                 AutomationProperties.AutomationId="AIDGroupList" TabIndex="8">
												<ListBox.Resources>
                                                 <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                            </ListBox.Resources>
											
										</ListBox>
									</Grid>
                        </ScrollViewer>
                    </Border>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</UserControl>
